package com.byxm.wlgw.control.admin;

import java.util.List;

import com.byxm.wlgw.bean.Splb_sBean;
import com.byxm.wlgw.control.BaseAction;
import com.byxm.wlgw.service.Splb_sService;

/**
 * 商品功能
 * @author Administrator
 *
 */
public class Splb_s_glAction  extends BaseAction{
	private static final long serialVersionUID = 1L;
	
	private List<Splb_sBean> lstSplbs;
	
	private String splbfid;
	
	private Splb_sBean splbsBean;

	private boolean bflag;
	Splb_sService splb_sService=new Splb_sService();
	/**
	 * 查看商品功能
	 * @return
	 */
	public String list(){
		try {
			lstSplbs=splb_sService.getSplb_s(Integer.parseInt(splbfid));
		} catch (NumberFormatException e) {
			e.printStackTrace();
		} catch (Exception e) {
			e.printStackTrace();
		}
		return "success_01";
	}
	/**
	 * 保存商品功能
	 * @return
	 */
	public String save(){
		try {
			//执行一下保存
			splb_sService.saveSplbs(splbsBean);
		} catch (Exception e) {
			e.printStackTrace();
		}
		return "success_02";
	}
	/**
	 * 删除
	 * @return
	 */
	public String delete(){
		try {
			if(splb_sService.deleteSplbs(splbsBean.getSplbsid())){
				bflag=true;
			}else{
				bflag=false;
			}
		} catch (Exception e) {
			e.printStackTrace();
		}
		return "json";
	}


	
	
	
	
	/****setter  getter********/
	public List<Splb_sBean> getLstSplbs() {
		return lstSplbs;
	}

	public void setLstSplbs(List<Splb_sBean> lstSplbs) {
		this.lstSplbs = lstSplbs;
	}
	public String getSplbfid() {
		return splbfid;
	}
	public void setSplbfid(String splbfid) {
		this.splbfid = splbfid;
	}
	public Splb_sBean getSplbsBean() {
		return splbsBean;
	}
	public void setSplbsBean(Splb_sBean splbsBean) {
		this.splbsBean = splbsBean;
	}
	public boolean isBflag() {
		return bflag;
	}
	public void setBflag(boolean bflag) {
		this.bflag = bflag;
	}
	
	
}
